# Maintainer: Thore Bödecker <foxxx0@archlinux.org>
pkgbase='python-kajiki'
_pkgbase="${pkgbase#python-}"
pkgname=("python-${_pkgbase}")
pkgver=0.9.2
pkgrel=1
pkgdesc='Python XML-based template engine with Genshi-like syntax and Jinja-style blocks'
arch=('any')
url='https://github.com/nandoflorestan/kajiki'
license=('LGPL')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-sphinx' 'python-wheel')
checkdepends=('python-babel' 'python-pytest')
source=("${_pkgbase}-${pkgver}.tar.gz::https://github.com/nandoflorestan/kajiki/archive/v${pkgver}.tar.gz")
sha512sums=('60c9e82c0a8768772c36fd8a54283023d74fc73133f963f4eb6b39419ed89f1244f06f7b6ca107d819d1204efaffbb8ef20e2da02fa8a9648c8e90a6b76a90cf')

build() {
  cd "${srcdir}/${_pkgbase}-${pkgver}"
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd "${srcdir}/${_pkgbase}-${pkgver}"
  export PYTHONPATH="${PWD}"
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest -vvv -s -ra --showlocals tests/
}

package() {
  cd "${srcdir}/${_pkgbase}-${pkgver}"
  python -m installer --destdir="$pkgdir" dist/*.whl
}
